#define _CRT_SECURE_NO_WARNINGS 1
#include<cstdio>
int main()
{
	int date = 0;
	int i = 0;
	int a = 0;
	int month = 2;
	scanf("%d", &date);
	printf("Mon      Tue      Wed      Thu      Fri      Sat      Sun\n");
	int start_date = (date + (7 - date % 7));
	int m = 2;
	int n = start_date;
	
	int arr1[10] = { 0,0,28,31,30,31,30,3 };
	
	while (m < 8)
	{
		for ( i=n; i <= arr1[month]; i++)
		{
			printf("0%.2lf    ", (m + n * 0.01));
			a++;
			n++;
			if (a == 7)
			{
				a = 0;
				printf("\n");
			}
		}
		n = 1;
		month++;
		m++;
	}

	return 0;
}

